#include "_AFX.H"
const struct CRuntimeClass CObject::classCObject = {"CObject",sizeof(CObject),0xffff,NULL,NULL,NULL};

CRuntimeClass* CObject::GetRuntimeClass() const
{
	return RUNTIME_CLASS(CObject);
}

BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
{
	CRuntimeClass* pClassThis = GetRuntimeClass();
	return pClassThis->IsDerivedFrom(pClass);
}


BOOL CRuntimeClass::IsDerivedFrom(const CRuntimeClass* pBaseClass) const
{
	const CRuntimeClass* pClassThis = this;
	while(pClassThis)
	{
		if (pClassThis == pBaseClass)
		{
			return TRUE;
		}
		pClassThis = pClassThis->m_pBaseClass;
	}
	return FALSE;
}


CObject* CRuntimeClass::CreateObject()
{
	if(m_pfnCreateObject == NULL)
	{
		return NULL;
	}
	return (*m_pfnCreateObject)();
}